<?php
namespace Admin\Controller;
use Think\Controller;

class StatusClassController extends CommController {
	//广告分类信息
	public function index(){
        $map['is_delete'] = 0;
        $model = D('StatusClass');
        $dataList = $this->getPageList($model, $map);
        $paramter['action'] = 'adlass';
        
        $this->assign('paramter',$paramter);
        $this->assign('dataList',$dataList);
        $this->display();
    }


    //修改分类
    public function updateclass(){
        if(IS_POST){

            $modelName = 'StatusClass';
            $model = D ( $modelName );
            //$_POST['create_time'] = time();
            if(I('post.id')){
        		$refresh = $_POST ['refresh'] ? $_POST ['refresh'] : 'refreshClose';
        		$return = $model->commUpdate ( $_POST );
        		$this->dwzSuccess ( $return ['info'], $return ['status'], 'adclass', $refresh );
            }else{
                $refresh = $_POST ['refresh'] ? $_POST ['refresh'] : 'refreshClose';
                $_POST['create_time'] = time();
                $return = $model->commInsert ( $_POST );
                $this->dwzSuccess ( $return ['info'], $return ['status'], 'adclass', $refresh );
            }
        }else{
            if(I('get.id')){
                //编辑
                $id = I('get.id');
                $dataInfo = D('StatusClass')->where(array('id'=>$id))->find();
                $this->assign('dataInfo',$dataInfo);
                $this->display();
            }else{
                $this->display();
            }
        }
    }
}